package com.exercise.ThreadAttribute;

/**
 * 栈追踪
 */
public class ThreadStackTraceExample {
    public static void main(String[] args) {
        Thread thread = new Thread(() -> {
            StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
            for (StackTraceElement stackTraceElement : stackTrace) {
                System.out.println(stackTraceElement);
            }
        });
        thread.start();
    }
}
